#include "StdAfx.h"
#include "FormEdit.h"
#include "FormMain.h"
#include "List.h"

namespace wlog {

	int FormEdit::LoadContent(void)
	{
		if (this->id_list > 0)
		{
			List^ list = gcnew List(this->id_list);
			this->richTextBox1->Text = list->name;
		}

		return 0;
	}

	int FormEdit::SaveContent(void)
	{
		if (this->id_list > 0)
		{
			List^ list = gcnew List(this->id_list);
			list->name = this->richTextBox1->Text;
			list->Save();

			FormMain::FM->UpdateWlogListSelectedItem(this->richTextBox1->Text);
		}
		return 0;
	}

}